<?php

use Illuminate\Foundation\Inspiring;

/*
|--------------------------------------------------------------------------
| Console Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of your Closure based console
| commands. Each Closure is bound to a command instance allowing a
| simple approach to interacting with each command's IO methods.
|
*/

Artisan::command('inspire', function () {
    $this->comment(Inspiring::quote());
})->describe('Display an inspiring quote');

Artisan::command('version:publish {branch}', function () {
    /** @var Illuminate\Foundation\Console\ClosureCommand $this */
    $branch = ucfirst($this->argument('branch'));

    $class = 'App\Project\Version\Publish\\' . $branch;

    (new $class($this))->handle('install');

})->describe('版本发布命令');

//Artisan::command('version:rollback {branch}', function () {
//    /** @var Illuminate\Foundation\Console\ClosureCommand $this */
//    $branch = ucfirst($this->argument('branch'));
//
//    $class = 'App\Project\Version\Publish\\' . $branch;
//
//    (new $class($this))->handle('rollback');
//
//})->describe('版本回滚命令');